package com.zb.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjGoodsType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/1 0001
 **/
@Data
@ApiModel("商品类型列表对象")
public class GoodsTypeListVo {
    @ApiModelProperty(value = "类型ID")
    private Long id;

    @ApiModelProperty(value = "分类名称")
    private String name;

    @ApiModelProperty(value = "类型状态：false-启用，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static GoodsTypeListVo beanToVo(ZjGoodsType type) {
        GoodsTypeListVo vo = new GoodsTypeListVo();
        BeanUtils.copyProperties(type, vo);
        vo.setStatus(type.getDisabled());
        vo.setCreateTime(type.getGmtCreate());
        vo.setUpdateTime(type.getGmtUpdate());
        return vo;
    }
}
